Sketch in a functional, cross-platofrm help.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 20 Jul 2009 01:38:40 +0000 (01:38 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 20 Jul 2009 01:38:40 +0000 (01:38 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3717 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/gui/help.cpp
gpsbabel/gui/help.h
gpsbabel/gui/help/gpsbabel.html [new file with mode: 0644]

index e5816f09b6e3256cbf3643f780cbdcde80fba6b8..b018880248750f0cfe6d8352595a6ccd8e33f76e 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: help.cpp,v 1.1 2009-07-05 21:14:56 robertl Exp $
+// $Id: help.cpp,v 1.2 2009-07-20 01:38:38 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
 //------------------------------------------------------------------------
 #include "help.h"
 #include <QApplication>
-#include <QString>
-#include <QProcess>
-
-
-//------------------------------------------------------------------------
-#ifndef _WIN32
-void ShowUrl(const QString &url) 
-{
-  QString progName = QApplication::applicationDirPath() + "/showUrl.sh";
-  QStringList args;
-  args << url;
-  QProcess::startDetached(progName, args);
-}
-#else
-#include <windows.h>
-void ShowUrl(const QString &url) 
-{
-  ShellExecuteA(0, "open", url.toStdString().c_str(), 0, 0, SW_SHOWNORMAL);
-}
-#endif
+// #include <QProcess>
+// #include <QString>
+#include <QUrl>
+#include <QWebView>
 
 //------------------------------------------------------------------------
 void ShowHelp(const char *name)
 {
-  QString urlname = "file://" + QApplication::applicationDirPath() + "/help/" + name;
-  ShowUrl(urlname);
+  QUrl urlname("file://" + QApplication::applicationDirPath() + 
+                "/help/" + name);
+  // FIXME(robertl): This shoud probably parent from QApplication::mainWidget();
+  QWebView *view = new QWebView();
+  view->setWindowTitle("GPSBabel Help");
+  view->load(urlname);
+  view->show();
 }
 
index 747dbb4667f289cd8f761249b53b83926b7599da..70386543e8f55f1b5448ad317974f6bf36156cc2 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-\r
-// $Id: help.h,v 1.1 2009-07-05 21:14:56 robertl Exp $\r
+// $Id: help.h,v 1.2 2009-07-20 01:38:40 robertl Exp $\r
 //------------------------------------------------------------------------\r
 //\r
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.\r
@@ -23,7 +23,6 @@
 #ifndef HELP_H\r
 #define HELP_H\r
 #include <QString>\r
-extern void ShowUrl(const QString &url);\r
 extern void ShowHelp(const char *name);\r
 \r
 #endif\r
diff --git a/gpsbabel/gui/help/gpsbabel.html b/gpsbabel/gui/help/gpsbabel.html
new file mode 100644 (file)
index 0000000..fd07cbc
--- /dev/null
@@ -0,0 +1,3 @@
+<p>This is the local help.  It currently isn't very helpful.</p>
+<p>The <a href="http://www.gpsbabel.org/htmldoc-development"> online help 
+   is mo betta.</p>